package socketmvc.core;

import org.tio.core.Node;
import org.tio.server.TioServer;
import java.io.IOException;

public class IoServer {

    private final Node serverNode;

    private final TioServer server;


    public IoServer(TioServer server,Node serverNode) {
        this.server = server;
        this.serverNode = serverNode;
    }

    public Node getServerNode() {
        return serverNode;
    }

    public void start() throws IOException {
        server.start(serverNode.getIp(), serverNode.getPort());
    }

    public void stop(){
        server.stop();
    }
}
